import { ref, watch } from 'vue'

export default function useTitle(titleValue) {
  // document.title = title

  // 定义ref引用数据
  const title = ref(titleValue)

  watch(
    title,
    (newVal) => {
      document.title = newVal
    },
    {
      immediate: true,
    }
  )

  return title
}
